package com.fire.service.impl;

import com.fire.model.entity.Location;
import com.fire.mapper.LocationMapper;
import com.fire.service.ILocationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2024-04-04
 */
@Service
public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> implements ILocationService {

    @Override
    public List<String> queryCity() {
        List<String> cities = baseMapper.selectList(null)
                .stream().map(item -> item.getLocationName())
                .collect(Collectors.toList());
        return cities;
    }
}
